import config from "@/utils/config.js"

//根据编号获取车辆详情
const getCarDetail = async (token) => {
	let url = config.baseUrl + "wx/driver/vechiclestop";
	let param = {
		token: token,
	}
	let res = await config.getData(url, param);
	return res;
}

//保存报修数据
const wrongDataSave = async (obj) => {
	let url = config.baseUrl + "wx/driver/vechiclestop";
	let param = {
		reason: obj.reason,
		vehicleId: obj.vehicleId,
		isTasking: obj.isTasking,
		taskId: obj.taskId,
		token: obj.token,
	}
	let res = await config.postData(url, param);
	return res;
}

//解除车辆报修
const secureCar = async (vehicleId, token) => {
	let url = config.baseUrl + "wx/driver/unstop";
	let param = {
		vehicleId: vehicleId,
		token: token,
	}
	let res = await config.getData(url, param);
	return res;
}

export default {
	getCarDetail,
	wrongDataSave,
	secureCar
}